package com.bw.server.api

import com.bw.common.entity.BaseRes
import com.bw.server.entity.AddDeviceEntity
import com.bw.server.entity.AddDeviceEntityNull
import com.bw.server.entity.DetailDeviceEntity
import com.bw.server.entity.DeviceEntityItem
import com.bw.server.entity.DeviceStartEntity
import com.bw.server.entity.TransferInspectionEntity
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.PATCH
import retrofit2.http.POST
import retrofit2.http.Path
import retrofit2.http.Query

interface ServerApiService {
    //设备列表页面
    @GET("/api/inspection-orders")
    suspend fun getDevice():BaseRes<List<DeviceEntityItem>>

    //添加巡检任务
    @POST("/api/inspection-orders")
    suspend fun getAddDevice(@Body addDeviceEntity: AddDeviceEntityNull):BaseRes<AddDeviceEntity>


    //设备详情页面
    @GET("/api/inspection-orders/{id}")
    suspend fun getDetailDevice(@Path("id")id:Int):BaseRes<DetailDeviceEntity>

    //开始巡检
    @PATCH("/api/inspection-orders/start/{id}")
    suspend fun startInspection(@Path("id")id:Int):BaseRes<DeviceStartEntity>

    //转派任务
    @PATCH("/api/inspection-orders/transfer/{id}")
    suspend fun transferInspection(@Path("id")id:Int,@Query("inspector")inspector:String):BaseRes<TransferInspectionEntity>








}